@use "sass:math";

@import '../../../../../../stylesheets/colors';
@import '../../../../../../stylesheets/variables';

.interlinks-card {
  border: 1px solid $autocomplete-border-color;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  width: calc(22% - #{$global-spacing * 2});
  margin: $global-spacing;
  color: inherit;
  transition: all 0.2s;
  flex: 1 0 auto;
  white-space: normal;

  &:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid fade-in($autocomplete-border-color, 0.02);
    background: rgba(200, 200, 200, 0.07);
  }

  @media screen and (max-width: 64em) {
    margin: math.div($global-spacing, 1.5);
    width: calc(30% - #{$global-spacing * 2});
  }

  @media screen and (max-width: 48em) {
    margin: math.div($global-spacing, 1.5);
    width: calc(45% - #{$global-spacing * 1.5});
  }

  @media screen and (max-width: 40em) {
    width: 85%;
  }
}

.interlinks-card__wrap {
  padding: $global-spacing * 1.5;
  padding-bottom: math.div($global-spacing, 1.5);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.interlinks-card__header {
  display: flex;
}

.interlinks-card__name {
  margin: 0;
  font-family: $font-family-code;
  font-weight: $font-weight-light;
  flex-grow: 1;
  word-break: break-word;
}

.interlinks-card__description {
  @include font-size-sm;
  color: $dark-raven;
  line-height: 1.5;
  margin: $global-spacing 0 0 0;
  word-break: break-word;
  flex-grow: 1;

  img {
    height: auto;
    max-width: 100%;
  }
}

.interlinks-card__publish-date {
  @include font-size-xs;
  color: $raven;
  border-top: 1px dashed lighten($raven, 50%);
  padding-top: $global-spacing * 0.5;
  margin-top: $global-spacing * 0.5;
}
